﻿using System.Collections.Generic;
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Web;
using AgileNYCWebService.Manager.Data;
using AgileNYCWebService.Manager.Data.Table;

namespace AgileNYCWebService
{
	// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
	[ServiceContract]
	public interface IAgileUsers
	{
		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebInvoke(Method = "POST",
			ResponseFormat = WebMessageFormat.Json,
			RequestFormat = WebMessageFormat.Json)]
		JsonResult Login(Users user);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebInvoke(
			Method = "POST",
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "UploadPhoto/{userToken}")]

		JsonResult UploadPhoto(string userToken, Stream fileContents);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebGet(
			ResponseFormat = WebMessageFormat.Json,
			BodyStyle = WebMessageBodyStyle.Wrapped,
			RequestFormat = WebMessageFormat.Json,
			UriTemplate = "DeletePhoto?userToken={userToken}")]

		string DeletePhoto(string userToken);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebGet(
			ResponseFormat = WebMessageFormat.Json,
			BodyStyle = WebMessageBodyStyle.Wrapped,
			RequestFormat = WebMessageFormat.Json,
			UriTemplate = "GetUserDetails?userToken={userToken}")]
		string GetUserDetails(string userToken);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebInvoke(Method = "POST",
			ResponseFormat = WebMessageFormat.Json,
			RequestFormat = WebMessageFormat.Json)]
		JsonResult SaveUserDetails(Users userDetails);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebGet(
			ResponseFormat = WebMessageFormat.Json,
			BodyStyle = WebMessageBodyStyle.Wrapped,
			UriTemplate = "SendNotification?userToken={userToken}&code={code}")]
		string SendNotification(string userToken, int code);

		[OperationContract]
		[WebGet(
			ResponseFormat = WebMessageFormat.Json,
			BodyStyle = WebMessageBodyStyle.Wrapped,
			UriTemplate = "ReplyNotification?userToken={userToken}&code={code}&agree={agree}")]
		void ReplyNotification(string userToken, int code, bool agree);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebGet(
			ResponseFormat = WebMessageFormat.Json,
			BodyStyle = WebMessageBodyStyle.Wrapped,
			UriTemplate = "CheckNotification?userToken={userToken}")]
		string CheckNotification(string userToken);

        [OperationContract]
        [return: MessageParameter(Name = "Result")]
        [WebGet(
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "CheckEmail?email={email}")]
        string CheckEmail(string email);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebGet(
			ResponseFormat = WebMessageFormat.Json,
			BodyStyle = WebMessageBodyStyle.Wrapped,
			UriTemplate = "Contacts?userToken={userToken}&offset={offset}&limit={limit}")]
		string Contacts(string userToken, int offset, int limit);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebInvoke(Method = "POST",
			ResponseFormat = WebMessageFormat.Json,
			RequestFormat = WebMessageFormat.Json)]
		JsonResult AddNote(Note noteData);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebInvoke(Method = "POST",
			ResponseFormat = WebMessageFormat.Json,
			RequestFormat = WebMessageFormat.Json)]
		JsonResult DeleteNote(Note noteData);

		[OperationContract]
		[return: MessageParameter(Name = "Result")]
		[WebGet(
			ResponseFormat = WebMessageFormat.Json,
			BodyStyle = WebMessageBodyStyle.Wrapped,
			UriTemplate = "DeleteContact?userToken={userToken}&code={code}")]
		string DeleteContact(string userToken, int code);
	}
}
